<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>   	
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="back/css/main.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="back/js/jquery-1.7.2.js"></script>
		<script type="text/javascript">

			/**
			 * 选中所有的复选框
			 * @param ids 复选框的name属性
			 * @param type 按钮类型
			 */
			function checkAllBtn(ids, id) {
				try {
					var t = $("#" +id);
					if(t.val() == "全选中") {
						$("[name="+ids+"]:checkbox").each(function() { 
							$(this).attr("checked", "true"); 
						}) 
						t.val("全不选");
					} else {
						$("[name="+ids+"]:checkbox").each(function() { 
							$(this).removeAttr("checked"); 
						})
						t.val("全选中");
					}
					return false;
				}catch(e) {
				}
			}
				
			
		</script>
	</head>
	<body>
		
		<form method="post" id="bannerForm" name="bannerForm">
			
			<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
				<tr>
					<td height="35" colspan="6" bgcolor="#FFFFFF">
						&nbsp;
						<img src="back/images/list.gif" />
						<a href="#" title="添加图片" style="font-size: 13px; color: #428EFF;">&nbsp;添加图片</a>
						<a href="#" onClick="javascript:window.location.reload()" title="刷新当前列表" style="font-size: 13px; color: #428EFF;">&nbsp;刷新页面</a>
						<a href="#" style="font-size: 13px; color: #428EFF;" onclick="writeBanner();return false;">&nbsp;生成文件</a>	
					</td>
				</tr>
				<tr>
					<td height="40" align="center" class="bg_tr">
						<b>全选</b>
					</td>
					<td height="40" align="center" class="bg_tr">
						<b>图片附件</b>
					</td>	
					<td align="center" class="bg_tr">
						<b>图片标题</b>
					</td>
					<td align="center" class="bg_tr">
						<b>图片链接</b>
					</td>
					<td align="center" class="bg_tr">
						<b>操作选项</b>
					</td>

				</tr>
				<s:iterator value="imageInfoVoList" id="il">
					<tr>
						<td width="5" align="left" class="td_bg">
							<input type="checkbox" name="ids" value="<s:property value='#il.imageId' />" />
						</td>
						<td height="40" align="center" class="td_bg">
							<img id="1" src="<s:property value='#il.imageSavePath' />" width="100" height="51">
						</td>
						<td align="center" class="td_bg">[<s:property value='#il.navTitle' />]---<s:property value='#il.imageTitle' /></td>
						<td align="center" class="td_bg">
							<s:property value='#il.imageInfo' />
						</td>
						<td align="center" class="td_bg">
							<a href="image_upload.action?nav.navId=<s:property value='nav.navId' />&image.imageId=<s:property value='#il.imageId' />">编辑图片</a>
							<a href="image_del.action?nav.navId=<s:property value='nav.navId' />&image.imageId=<s:property value='#il.imageId' />">删除图片</a>
						</td>
					</tr>
				
				</s:iterator>
				<tr>
					<td height="40" colspan="6" align="center" class="td_bg" style="font-size: 13px;">
						<input value="全选中" type="button" id="all" onClick="checkAllBtn('ids','all')" style="cursor: pointer;" />
						<input value="批量删除" type="button" onClick="javascript:return batchDelete()" />
					</td>
				</tr>
				<tr>
					<td height="40" colspan="6" align="center" class="td_bg" style="font-size: 13px;">
						共有<s:property value='totalCount' />条记录 每页显示<s:property value='pageSize' />个记录
						
						<a href="imageList_find.action?pageNo=1" title="跳转到首页">首页</a>
						<s:if test="%{pageNo-1>0}">
							<a href="imageList_find.action?pageNo=<s:property value='pageNo-1' />">
						</s:if>
						上一页
						<s:if test="%{pageNo-1>0}">
							</a>
						</s:if>
						<s:iterator id="pn" begin="1" end="5">
							<s:if test="pageNo==#pn">
								<font title="当前在第<s:property value='#pn' />页">[<s:property value='#pn' />]</font>
							</s:if>
							<s:elseif test="%{#pn<pageCount}">
								<a href="imageList_find.action?pageNo=<s:property value='#pn' />">[<s:property value='#pn' />]</a>
							</s:elseif>
						</s:iterator>
						<s:if test="%{pageNo+1<=pageCount}">
							<a href="imageList_find.action?pageNo=<s:property value='pageNo+1' />">
						</s:if>
						下一页
						<s:if test="%{pageNo+1<=pageCount}">
						</a>
						</s:if>
						
						<a href="imageList_find.action?pageNo=<s:property value='pageCount' />" title="跳转到末页">&nbsp;末页</a>

					</td>
				</tr>
			</table>
		</form>
	</body>
</html>





